package com.fansl.allround.ucenter.api.feign.factory;

import com.fansl.allround.ucenter.api.feign.RemoteUcenterUserService;
import com.fansl.allround.ucenter.api.feign.fallback.RemoteUcenterUserServiceFallbackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author fansl
 * @Description: TODO
 * @date 2019/9/25 11:09
 */
@Component
public class RemoteUcenterUserServiceFallbackFactory implements FallbackFactory<RemoteUcenterUserService> {
    @Override
    public RemoteUcenterUserService create(Throwable throwable) {
        RemoteUcenterUserServiceFallbackImpl impl = new RemoteUcenterUserServiceFallbackImpl();
        impl.setCause(throwable);
        return impl;
    }
}
